﻿@model projectManagementWeb.Models.RegisterModel

@{
    ViewBag.Title = "Creación de Usuario";
}
<p align="right">
   @Html.ActionLink("<< Regresar", "AdminAccounts","Admin")
</p>

<h2>Creación de Usuarios</h2>
<p>
    Use la siguiente forma para crear un usuario nuevo. 
</p>
<p>
    Las contraseñas deben de tener un minimo de @Membership.MinRequiredPasswordLength caracteres.
    @*Passwords are required to be a minimum of @Membership.MinRequiredPasswordLength characters in length.*@
</p>


<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true, "No se pudo crear el usuario. Corrija los errores e intentelo de nuevo.")
    <div>
        <fieldset>
            <legend>Información del Usuario</legend>
            <table>
                <tr>
                    <td  class="editor-label">@Html.LabelFor(m => m.UserName)</td>
                    <td class="editor-field">@Html.TextBoxFor(m => m.UserName) @Html.ValidationMessageFor(m => m.UserName)</td>
                </tr>
                <tr>
                    <td class="editor-label">@Html.LabelFor(m => m.FirstName)</td>
                    <td class="editor-field">@Html.TextBoxFor(m => m.FirstName) @Html.ValidationMessageFor(m => m.FirstName)</td>
                </tr>
                <tr>
                    <td class="editor-label">@Html.LabelFor(m => m.LastName)</td>
                    <td class="editor-field">@Html.TextBoxFor(m => m.LastName) @Html.ValidationMessageFor(m => m.LastName)</td>
                </tr>
                <tr>
                    <td class="editor-label">@Html.LabelFor(m => m.Email)</td>
                    <td class="editor-field">@Html.TextBoxFor(m => m.Email) @Html.ValidationMessageFor(m => m.Email)</td>
                </tr>
                <tr>
                    <td class="editor-label">@Html.LabelFor(m => m.Password)</td>
                    <td class="editor-field">@Html.PasswordFor(m => m.Password) @Html.ValidationMessageFor(m => m.Password)</td>
                </tr>
                <tr>
                    <td class="editor-label">@Html.LabelFor(m => m.ConfirmPassword)</td>
                    <td class="editor-field">@Html.PasswordFor(m => m.ConfirmPassword) @Html.ValidationMessageFor(m => m.ConfirmPassword)</td>
                </tr>
                <tr>
                @{
                var QuestionList = new List<SelectListItem>(){
                    new SelectListItem(){Value="-1",Text="------------------"},
                    new SelectListItem(){Value="Comida Favorita",Text="Comida Favorita"},
                    new SelectListItem(){Value="Bebida",Text="Bebida"},
                    new SelectListItem(){Value="Pelicula Favorita",Text="Pelicula Favorita"}
                };
                }
                    <td class="editor-label">@Html.LabelFor(m => m.Question)</td>
                    <td class="editor-field">@Html.DropDownListFor(m => m.Question, QuestionList) @Html.ValidationMessageFor(m => m.Question)</td>
                </tr>
                <tr>
                    <td class="editor-label">@Html.LabelFor(m => m.Answer)</td>
                    <td class="editor-field">@Html.TextBoxFor(m => m.Answer) @Html.ValidationMessageFor(m => m.Answer)</td>
                </tr>
                <tr>
                    <td class="editor-label">@Html.LabelFor(m => m.Rol)</td>
                    <td class="editor-field">@Html.DropDownListFor(m=> m.Rol, Model.SecurityRoles) @Html.ValidationMessageFor(m => m.Rol)
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="center"><input type="submit" value="Crear" /></td>
                </tr>
            </table>
        </fieldset>
           
    </div>
}
